package com.guli;

import com.guli.client.CanalClient;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;

/**
 * @author zxc
 * @date 2023/04/30 15:32
 **/
@SpringBootApplication
public class CanalApplication implements CommandLineRunner {

    @Resource
    private CanalClient canalClient;

    public static void main(String[] args) {
        SpringApplication.run(CanalApplication.class , args);
    }

    @Override
    public void run(String... args) throws Exception {
        // 当前项目启动的时候，就同步开启cancel监听;
        canalClient.run();
    }
}
